<template>
	<section class="aui-flexView">
		<section class="aui-scrollView">
			<div class="aui-tab" data-ydui-tab>
				<div class="tab-panel">
					<div class="tab-panel-item">
						<block v-for="(item,index3) in lists" :key="index3">
							<view class="_height"></view>
							<div class="tab-item">
								<a href="javascript:void(0);" class="aui-well-item aui-well-item-clear">
									<!-- <div class="aui-well-item-hd">
										<img :src="menuList2.logoimg" alt="">
									</div> -->
									<div class="aui-well-item-bd">
										<h3>{{item.meet_info.meet_time || ''}}</h3>
									</div>
									<span class="aui-well-item-fr">{{item.order_id || ''}}</span>
								</a>
								<div class="aui-mail-product">
									<a href="javascript:;" class="aui-mail-product-item">
										<div class="aui-mail-product-item-hd">
											<img :src="item.img" alt="">
										</div>
										<div class="aui-mail-product-item-bd">
											<block v-for="(a_item,a_index) in item.meet_info.meet_Matters" :key="a_index">
												<text>{{a_item.tag || ''}}</text>
											</block>
										</div>
									</a>
								</div>
								<a href="javascript:;" class="aui-mail-payment">
									<p>
										{{`${item.meet_info.meet_place.name} ${item.meet_info.meet_place.address}` || ''}}
									</p>
								</a>
							</div>

						</block>
					</div>
				</div>
				<u-loadmore :status="status" />
			</div>
		</section>
	</section>
</template>

<script>
	import {
		getOrderLists
	} from '../../api/user.js';
	export default {
		data() {
			return {
				status: 'loadmore',
				page: 1,
				pageSize: 10,
				scrollLeft: 0,
				isClickChange: false,
				currentTab: 0,
				lists: []
			}
		},
		onLoad() {
			this.getOrderLists();
		},
		// 上拉加载数据
		onReachBottom() {
			if (this.status == 'nomore') return;
			this.status = 'loading';
			this.page = ++this.page;
			// 获取列表数据
			this.getOrderLists();
		},
		methods: {
			// 获取搭子列表
			getOrderLists() {
				getOrderLists({
					page: this.page,
					pageSize: this.pageSize
				}).then((res) => {
					var data = res.data;
					if (res.code === 200) {
						this.lists.push(...data.data);
						// 判断数据数量，修改状态
						if (data.data.length == 0 || data.data.length < this.pageSize) {
							this.status = 'nomore';
							return;
						}
					} else {
						uni.$u.toast('获取订单列表失败');
					}
				}).catch((err) => {
					uni.$u.toast(err);
				});
			},
			swichMenu: async function(current) { //点击其中一个选项
				if (this.currentTab == current) {
					return false;
				} else {
					this.currentTab = current;
					this.setScrollLeft(current);
				}
			},
			swiperChange: async function(e) {
				let index = e.target.current;
				this.setScrollLeft(index);
				this.currentTab = index;
			},
			setScrollLeft: async function(tabIndex) {
				let leftWidthSum = 0;
				for (var i = 0; i <= tabIndex; i++) {
					let nowElement = await this.getWidth('tabNum' + i);
					leftWidthSum = leftWidthSum + nowElement.width;
				}
				let winWidth = uni.getSystemInfoSync().windowWidth;
				this.scrollLeft = leftWidthSum > winWidth ? (leftWidthSum - winWidth) : 0
			},
			getWidth: function(id) { //得到元素的宽高
				return new Promise((res, rej) => {
					uni.createSelectorQuery().select("#" + id).fields({
						size: true,
						scrollOffset: true
					}, (data) => {
						res(data);
					}).exec();
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f8f9fa;
	}
</style>
<style scoped>
	/* 公共样式表css */
	html,
	body {
		color: #333;
		margin: 0;
		height: 100%;
		font-family: "Myriad Set Pro", "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		font-weight: normal;
	}

	* {
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
	}

	a {
		text-decoration: none;
		color: #000;
	}

	a,
	label,
	button,
	input,
	select {
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
	}

	img {
		border: 0;
	}

	body {
		background: #fff;
		color: #666;
	}

	html,
	body,
	div,
	dl,
	dt,
	dd,
	ol,
	ul,
	li,
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	p,
	blockquote,
	pre,
	button,
	fieldset,
	form,
	input,
	legend,
	textarea,
	th,
	td {
		margin: 0;
		padding: 0;
	}

	a {
		text-decoration: none;
		color: #08acee;
	}

	button {
		outline: 0;
	}

	img {
		border: 0;
	}

	button,
	input,
	optgroup,
	select,
	textarea {
		margin: 0;
		font: inherit;
		color: inherit;
		outline: none;
	}

	li {
		list-style: none;
	}

	a {
		color: #666;
	}

	.clearfix::after {
		clear: both;
		content: ".";
		display: block;
		height: 0;
		visibility: hidden;
	}

	.clearfix {}
	
	._height{
		width: 100%;
		height:20rpx;
		background-color:#f8f9fa;
	}
	
	/* 必要布局样式css */
	.aui-flexView {
		width: 100%;
		height: 100%;
		margin: 0 auto;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-orient: vertical;
		-webkit-box-direction: normal;
		-webkit-flex-direction: column;
		-ms-flex-direction: column;
		flex-direction: column;
	}

	.aui-scrollView {
		width: 100%;
		height: 100%;
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		-ms-flex: 1;
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		position: relative;
		/* margin-top: -44px; */
	}

	.aui-navBar {
		height: 44px;
		position: relative;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		z-index: 1002;
		background: #ffffff;
	}

	.aui-navBar:after {
		content: '';
		position: absolute;
		z-index: 2;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 1px;
		border-bottom: 1px solid #ffffff;
		-webkit-transform: scaleY(0.5);
		transform: scaleY(0.5);
		-webkit-transform-origin: 0 100%;
		transform-origin: 0 100%;
	}

	.aui-navBar-item {
		height: 44px;
		min-width: 25%;
		-webkit-box-flex: 0;
		-webkit-flex: 0 0 25%;
		-ms-flex: 0 0 25%;
		flex: 0 0 25%;
		padding: 0 0.9rem;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
		font-size: 0.7rem;
		white-space: nowrap;
		overflow: hidden;
		color: #a0a0a0;
		position: relative;
	}

	.aui-navBar-item:first-child {
		-webkit-box-ordinal-group: 2;
		-webkit-order: 1;
		-ms-flex-order: 1;
		order: 1;
		margin-right: -25%;
		font-size: 0.9rem;
		font-weight: bold;
	}

	.aui-navBar-item:last-child {
		-webkit-box-ordinal-group: 4;
		-webkit-order: 3;
		-ms-flex-order: 3;
		order: 3;
		-webkit-box-pack: end;
		-webkit-justify-content: flex-end;
		-ms-flex-pack: end;
		justify-content: flex-end;
	}

	.aui-center {
		-webkit-box-ordinal-group: 3;
		-webkit-order: 2;
		-ms-flex-order: 2;
		order: 2;
		display: -webkit-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-pack: center;
		-webkit-justify-content: center;
		-ms-flex-pack: center;
		justify-content: center;
		-webkit-box-align: center;
		-webkit-align-items: center;
		-ms-flex-align: center;
		align-items: center;
		height: 44px;
		width: 50%;
		margin-left: 25%;
	}

	.aui-center-title {
		text-align: center;
		width: 100%;
		white-space: nowrap;
		overflow: hidden;
		display: block;
		text-overflow: ellipsis;
		font-size: 0.95rem;
		color: #3c3c3c;
	}

	.icon {
		width: 20px;
		height: 20px;
		display: block;
		border: none;
		float: left;
		background-size: 20px;
		background-repeat: no-repeat;
	}

	.icon-return {
		background-image: url("");
	}

	.icon-sys {
		background-image: url("");
	}

	.tab-nav {
		background: #FFFFFF;
		height: 40px;
		line-height: 40px;
		/* border-radius: 80px; */
		display: block;
		/* margin: 0 auto; */
		position: fixed;
		width: 100%;
		margin-bottom: 15%;
		/* width: 185px; */
		z-index: 9999;
	}

	.tab-nav:after {
		content: '';
		position: fixed;
		z-index: 2;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 1px;
		border-bottom: 1px solid #bbbbbb;
		-webkit-transform: scaleY(0.5);
		transform: scaleY(0.5);
		-webkit-transform-origin: 0 100%;
		transform-origin: 0 100%;
	}

	.tab-nav-item {
		height: 40px;
		line-height: 40px;
		position: relative;
		text-align: center;
		color: #585858;
		font-size: 0.9rem;
		display: block;
		float: left;
		border-radius: 80px;
		/* padding: 0 15px; */
		width: 20%;
		margin: 0 auto;
	}

	.tab-nav-item.tab-active {
		/* background-color: #51bd03; */
	}

	.tab-nav-item.tab-active a {
		color: #000000;
		font-weight: bold;
	}

	.tab-nav-item a {
		display: inherit;
		color: inherit;
		font-size: 0.8rem;
		color: #464646;
	}

	.tab-panel {
		width: 100%;
	}

	.tab-item {
		
	}

	.tab-panel .tab-panel-item {
		width: 95%;
		background-color: #fff;
		margin: 0rpx auto;
		border-radius: 10rpx;
	}

	.tab-nav-item.tab-active:before {
		content: '';
		width: 40%;
		height: 0px;
		position: absolute;
		left: 50%;
		bottom: 0;
		margin-left: -20%;
		z-index: 4;
		background-color: #f23030;
		border-radius: 120px;
		border: 1px solid #f23030;
	}

	.aui-well-item {
		padding: 20rpx 20rpx 20rpx 20rpx;
		position: relative;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
	}

	.aui-well-item-bd {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		min-width: 0;
	}

	.aui-well-item-bd h3 {
		color: #333;
		font-size: 28rpx;
		position: relative;
		/* padding-left: 20px; */
		font-weight: normal;
		padding-bottom: 0;
		text-align: left;
	}

	.aui-well-item-fr {
		font-size: 0.85rem;
		text-align: right;
		color: #999999;
		position: relative;
	}

	.aui-mail-product {
		background: #f7f7f7;
		padding: 0rpx;
		position: relative;
		overflow: hidden;
	}

	.aui-mail-product-item {
		/* padding: 15px; */
		position: relative;
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		-webkit-box-align: center;
		-webkit-align-items: center;
		align-items: center;
	}

	.aui-mail-product-item-hd {
		margin-right: .8em;
		width: 70px;
		height: 70px;
		line-height: 70px;
		text-align: center;
	}

	.aui-mail-product-item-hd img {
		width: 100%;
		max-height: 100%;
		vertical-align: top;
	}

	.aui-mail-product-item-bd {
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
		min-width: 0;
	}

	.aui-mail-product-item-bd text {
		color: #404040;
		font-size: 28rpx;
		margin-right:10rpx;
	}

	.aui-mail-payment {
		padding: 10px 10px;
		position: relative;
		text-align: right;
		font-size: 28rpx;
		font-weight: 500;
		color: #333;
		overflow: hidden;
		display: block;
	}

	.aui-mail-payment p em {
		font-style: normal;
	}

	.aui-mail-payment p i {
		font-size: 1.3rem;
		font-style: normal;
	}

	.aui-mail-payment:after {
		content: '';
		position: absolute;
		z-index: 2;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 1px;
		border-bottom: 1px solid #e2e2e2;
		-webkit-transform: scaleY(0.5);
		transform: scaleY(0.5);
		-webkit-transform-origin: 0 100%;
		transform-origin: 0 100%;
	}


	.hd {
		display: none;
	}
</style>